<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib uri="http://sargue.net/jsptags/time" prefix="javatime" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>订单信息</title>
    <%@include file="../common/header.jsp" %>
    <%@include file="../common/top.jsp" %>
    <jsp:include page="../../common/layer.jsp"></jsp:include>
    <style>
        .subBtn{
            background:#34ad2a;
            font-size: 16px;
            margin-right: 40px;
        }
    </style>
</head>
<body>


<div class="section clearfix" style="margin-top: 10px;">
    <!--页面左边-->
    <%@include file="left.jsp" %>
    <!--/页面左边-->

    <!--页面左边-->
    <div class="right-auto">
        <div class="bg-wrap" style="min-height:765px;">
            <div class="sub-tit " style="margin: 0px;">
                <a class="add" href="${pathUrl }/home/center/orderIndex"><i class="iconfont icon-reply"></i>返回</a>
                <ul>
                    <li class="selected">
                        <a href="javascript:;">订单信息</a>
                    </li>
                </ul>
            </div>

            <div class="order-progress mini" style="margin: 22px 0px;">
                <ul>
                    <!--下单-->
                    <li <c:if test="${shopOrder.shopState eq 1}" > class="first active"</c:if> >
                        <div class="progress">下单</div>
                        <div class="info">
                            <javatime:format value="${shopOrder.addTime }" pattern="yyyy-MM-dd HH:mm:ss" />
                        </div>
                    </li>
                    <!--/下单-->
                    <!--发货-->
                    <li <c:if test="${shopOrder.shopState eq 2}" > class="first active"</c:if>>
                        <div class="progress">发货</div>

                    </li>
                    <!--/发货-->
                    <!--完成-->
                    <li <c:if test="${shopOrder.shopState eq 3}" > class="first active"</c:if> class="last">
                        <div class="progress">完成</div>
                    </li>
                    <!--/完成-->
                </ul>
            </div>



            <div class="form-box accept-box" style="margin: 0px;">
                <dl class="head form-group">
                    <dd>
                        订单号：${shopOrder.orderSn }
                    </dd>
                </dl>
                <dl class="form-group">
                    <dt>订单状态：</dt>
                    <dd>
					 <c:choose>
					   <c:when test="${shopOrder.shopState eq 0 }">未支付</c:when>
					   <c:when test="${shopOrder.shopState eq 1 }">已支付,未确认</c:when>
					   <c:when test="${shopOrder.shopState eq 2 }">已确认，已发货</c:when>
					   <c:when test="${shopOrder.shopState eq -1 }">已取消</c:when>
					 </c:choose>
                    </dd>
                </dl>

            </div>



            <div class="table-wrap" style="margin: 0px;">
                <table width="100%" border="0" cellspacing="0" cellpadding="5" class="ftable">
                    <tbody><tr>
                        <th align="left" colspan="2">商品信息</th>
                        <th width="10%">单价
                        <th width="10%">数量</th>
                        <th width="10%">金额</th>
                    </tr>
					 <c:forEach var="vo" items="${ orderGoodsList}">
                    <tr>
                        <td width="60">
                            <a target="_blank" href="${pathUrl }/home/goods/detail?id=${vo.shopOrderGoods.goodsId}">
                                <img onerror="this.src='${pathUrl }/public/images/nopic.png'"  src="${pathUrl}${vo.shopOrderGoods.goodsImg}" class="img">
                            </a>
                        </td>
                        <td align="left">
                            <a target="_blank" href="${pathUrl }/home/goods/detail?id=${vo.shopOrderGoods.goodsId}">
                             ${vo.shopOrderGoods.goodsName }
                            </a>
                            <p></p>
                        </td>
                        <td align="center">
                            <p>￥<f:formatNumber  value="${vo.shopOrderGoods.price }" pattern="0.00"/> </p>
                        </td>
                        <td align="center">${vo.shopOrderGoods.goNum }</td>
                        <td align="center">￥
                          <f:formatNumber value="${vo.shopOrderGoods.totalPrice }" pattern="0.00" />
                        </td>
                    </tr>
					</c:forEach>
                    <tr>
                        <td colspan="6" align="right">
                            <p style="font-size:22px;">应付总金额：<b class="red">￥
                             <f:formatNumber value="${shopOrder.totalMoney }" pattern="0.00"/>
                            </b></p>
                        </td>
                    </tr>
                    
                    </tbody></table>
            </div>



            <div class="form-box accept-box" style="margin: 0px;">
                <dl class="head form-group">
                    <dd>收货信息</dd>
                </dl>
                <dl class="form-group">
                    <dt>顾客姓名：</dt>
                    <dd>${shopOrder.userName }</dd>
                </dl>
                <dl class="form-group">
                    <dt>送货地址：</dt>
                    <dd>${shopOrder.province },${shopOrder.city },${shopOrder.area}${shopOrder.address }</dd>
                </dl>
                <dl class="form-group">
                    <dt>联系电话：</dt>
                    <dd>${shopOrder.phone } </dd>
                </dl>
                <dl class="form-group">
                    <dt>电子邮箱：</dt>
                    <dd>${shopOrder.email }</dd>
                </dl>
                <dl class="form-group">
                    <dt>备注留言：</dt>
                    <dd>${shopOrder.remark }</dd>
                </dl>

            </div>

            <div style="float: right;">
                <c:if test="${shopOrder.shopState==2}">
                    <button class="subBtn" onclick="shouHuo(${shopOrder.id})"  style="">确认收货</button>
                </c:if>
            </div>

        </div>
    </div>
    <!--/页面左边-->

</div>

</body>

<script>
    function shouHuo(id) {
        var url = "${pathUrl}/home/center/affirm?id="+id;
        window.location.href = url;
    }
</script>
</html>